<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
	<head>
		<title>欢迎进入阿尔法服装进销存管理系统V1.0</title>
		<link rel="shortcut icon" href="${pageContext.request.contextPath }/favicon.ico" type="image/x-icon"/> 
		<jsp:include page="/common.jsp"/>
	</head>
	<body class="easyui-layout">
		<div region="north" border="true" style="height:60px;background:#E6E6FA;padding-top:5px;padding-left:10px;">
			<div style="width:100%;text-align:center;font-family: sans-serif;font-size:24px;font-weight:bold;"><img src="${pageContext.request.contextPath}/resource/img/logo.gif"/></div>
			<div>${sessionScope.user.userName },欢迎您! <a href="${pageContext.request.contextPath }/system/user/loginout.htm">退出</a></div>		
		</div>
		<div region="west" split="true" title="导航菜单" style="width:200px;padding:10px;">
	    	<jsp:include page="/WEB-INF/jsp/security/role/tree.jsp"/>
		</div>
		<!-- <div region="south" border="false" style="height:50px;background:#A9FACD;padding:10px;"></div> -->
		<div region="center" title=""><iframe id="ifmain" frameborder="0" width="100%" height="99%" src="${pageContext.request.contextPath}/descindex.jsp"></iframe></div>
		
		<div id="_mask" style="display:none; position: absolute; z-index: 3; filter: alpha(opacity = 40); opacity: 0.4;background-image: url('${pageContext.request.contextPath }/resource/img/dialog_bg.png');"></div>
		<iframe id="iframepopup" style="position:absolute;z-index:5; top:200px; display:none; overflow: visible;" frameborder="0" src="about:blank"></iframe>
		
		<script>

			var menu;//缓存用户的菜单XML
			var curfileid;
			function cacheMenu(){
				var url = "${pageContext.request.contextPath}/security/role/genRoleMenuXML.htm";
				$.get(url, function(response) {
					menu = response;
				});
			}

			function treeSelect(id) {
				if (id.indexOf("file_") != 0)
					return;
				curfileid = id;

				var items = menu.getElementsByTagName("item");
				for ( var i = 0; i < items.length; i++) {
					if (items[i].getAttribute("id") == id) {
						var url = items[i].getAttribute("url");
						if (!url || url == '') {
							alert("请在【menu_all.xml】中配置路径！");
							return false;
						}
						if (url.indexOf('?') >= 0)
							url += "&tmp=" + new Date().getTime();
						else
							url += "?tmp=" + new Date().getTime();
						//alert(items[i].parentNode.getAttribute("text"));
						var title=items[i].parentNode.getAttribute("text")+" >> "+items[i].getAttribute("text");
						//setTitle(title);
						showinmain(url);
						break;
					}
				}
			}
			
			function showinmain(url) {
				document.getElementById("ifmain").src = "${pageContext.request.contextPath}"
						+ url;
			}

			function setTitle(title){
				if (!title || title.length == 0)
					title = "";
				$(".panel-title")[1].innerHTML = title;
			}
			cacheMenu();
		</script>
	</body>
</html>